package com.example.mobile2121606110syc0322homework;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    private TextView textView;
    private EditText editTextTextPersonName;
    private EditText editTextTextPassword;
    private EditText editTextTextPassword3;
    private EditText editTextTextPassword2;
    private Button button;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String account=editTextTextPersonName.getText().toString();
                String oldPSW=editTextTextPassword.getText().toString();
                String psw=editTextTextPassword3.getText().toString();
                String rePSW=editTextTextPassword2.getText().toString();
                Log.i("TAG", "账号: "+account
                +",旧密码："+oldPSW+",新密码："+psw+",再次输入新密码："+rePSW);
            }
        });
    }

    private void initView() {
        textView = (TextView) findViewById(R.id.textView);
        editTextTextPersonName = (EditText) findViewById(R.id.editTextTextPersonName);
        editTextTextPassword = (EditText) findViewById(R.id.editTextTextPassword);
        editTextTextPassword3 = (EditText) findViewById(R.id.editTextTextPassword3);
        editTextTextPassword2 = (EditText) findViewById(R.id.editTextTextPassword2);
        button = (Button) findViewById(R.id.button);
    }
}